/*
 * Path.h
 *
 *  Created on: Feb 25, 2011
 *      Author: santiago
 */

#ifndef PATH_H_
#define PATH_H_

#include <vector>
#include "TSPCostMatrix.h"

class TSPPath {
public:
	TSPPath();
	TSPPath(TSPCostMatrix *costs);
	TSPPath(TSPCostMatrix &costs);
	TSPPath(const TSPPath &path);
	TSPPath(const TSPPath &path, const unsigned int start_node, const unsigned int end_node);
	virtual ~TSPPath();

	void add_initial_node(unsigned int node_index);
	void add_node(unsigned int node_index);
	bool contains_node(unsigned int node_index) const;
	bool contains_pair(unsigned int i_node_index, unsigned int j_node_index) const;
	unsigned int get_size() const;
	unsigned int get_node_at(unsigned int index) const;

	double get_path_cost() const;
	bool check_path() const;

	void show() const;

	TSPPath& operator=(const TSPPath &original);

	TSPCostMatrix* get_costs() const;

private:
	TSPCostMatrix *_costs;

	double _path_cost;
	vector<unsigned int> _path;
};

#endif /* PATH_H_ */
